﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ShopCar.aspx.cs" Inherits="Demo.ShopCar" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link href="Content/bootstrap.css" rel="stylesheet" />
    <style>
        .row {
            width: 500px;
            margin: 0px auto;
        }

        .pro-gv {
            width: 500px;
        }

        #gvCar td {
            text-align: center;
            line-height: 200px;
            height: 200px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <div class="container">
            <div class="row">
                <%if (this.gvCar.Rows.Count != 0)
                    { %>
                <asp:GridView runat="server" ID="gvCar" AutoGenerateColumns="False" CssClass="text-center pro-gv table" OnRowDeleting="gvCar_RowDeleting" OnRowEditing="gvCar_RowEditing">
                    <Columns>
                        <asp:TemplateField HeaderText="图片">
                            <ItemTemplate>
                                <asp:Image ID="Image1" runat="server" ImageUrl='<%# "Images/"+ Eval("Product.ImageUrl") %>' Width="180" Height="180" />
                            </ItemTemplate>
                        </asp:TemplateField>

                        <asp:BoundField DataField="Product.GName" HeaderText="商品名称" />
                        <asp:BoundField DataField="Num" HeaderText="数量" />
                        <asp:TemplateField HeaderText="金额">
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# string.Format("{0:c}",Eval("PayMoney")) %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:ButtonField Text="删除" HeaderText="操作" ButtonType="Button" CommandName="delete" ControlStyle-CssClass="btn btn-default btn-group-sm">
                            <ControlStyle CssClass="btn btn-default btn-group-sm"></ControlStyle>
                        </asp:ButtonField>
                    </Columns>
                </asp:GridView>
                <asp:Button runat="server" ID="btnPay" Text="支付" CssClass="btn btn-default" OnClick="btnPay_Click" />
                <%}
                    else
                    {%>
                <h2 class="text-center">购物车中没有商品</h2>
                <%} %>
            </div>
        </div>
    </form>
</body>
</html>
